Optimal. Leaf size=158 \[ \frac{(g+h x)^3 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{3 h}-\frac{B h n x (b c-a d) (-a d h-b c h+3 b d g)}{3 b^2 d^2}-\frac{B n (b g-a h)^3 \log (a+b x)}{3 b^3 h}-\frac{B h^2 n x^2 (b c-a d)}{6 b d}+\frac{B n (d g-c h)^3 \log (c+d x)}{3 d^3 h} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.240267, antiderivative size = 170, normalized size of antiderivative = 1.08, number of steps used = 5, number of rules used = 3, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.097, Rules used = {6742, 2492, 72} \[ -\frac{B h n x (b c-a d) (-a d h-b c h+3 b d g)}{3 b^2 d^2}-\frac{B n (b g-a h)^3 \log (a+b x)}{3 b^3 h}+\frac{B (g+h x)^3 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{3 h}-\frac{B h^2 n x^2 (b c-a d)}{6 b d}+\frac{A (g+h x)^3}{3 h}+\frac{B n (d g-c h)^3 \log (c+d x)}{3 d^3 h} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6742
Rule 2492
Rule 72
Rubi steps
\begin{align*} \int (g+h x)^2 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx &=\int \left (A (g+h x)^2+B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx\\ &=\frac{A (g+h x)^3}{3 h}+B \int (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \, dx\\ &=\frac{A (g+h x)^3}{3 h}+\frac{B (g+h x)^3 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{3 h}-\frac{(B (b c-a d) n) \int \frac{(g+h x)^3}{(a+b x) (c+d x)} \, dx}{3 h}\\ &=\frac{A (g+h x)^3}{3 h}+\frac{B (g+h x)^3 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{3 h}-\frac{(B (b c-a d) n) \int \left (\frac{h^2 (3 b d g-b c h-a d h)}{b^2 d^2}+\frac{h^3 x}{b d}+\frac{(b g-a h)^3}{b^2 (b c-a d) (a+b x)}+\frac{(d g-c h)^3}{d^2 (-b c+a d) (c+d x)}\right ) \, dx}{3 h}\\ &=-\frac{B (b c-a d) h (3 b d g-b c h-a d h) n x}{3 b^2 d^2}-\frac{B (b c-a d) h^2 n x^2}{6 b d}+\frac{A (g+h x)^3}{3 h}-\frac{B (b g-a h)^3 n \log (a+b x)}{3 b^3 h}+\frac{B (d g-c h)^3 n \log (c+d x)}{3 d^3 h}+\frac{B (g+h x)^3 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{3 h}\\ \end{align*}
Mathematica [A] time = 0.337093, size = 204, normalized size = 1.29 \[ \frac{2 a^2 B d^3 h n (a h-3 b g) \log (a+b x)+b \left (d x \left (B h n (b c-a d) (2 a d h+2 b c h-6 b d g-b d h x)+2 A b^2 d^2 \left (3 g^2+3 g h x+h^2 x^2\right )\right )-2 b B n \log (c+d x) \left (b c \left (c^2 h^2-3 c d g h+3 d^2 g^2\right )-3 a d^3 g^2\right )+2 b B d^3 \left (3 a g^2+b x \left (3 g^2+3 g h x+h^2 x^2\right )\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{6 b^3 d^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.576, size = 1389, normalized size = 8.8 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.19188, size = 397, normalized size = 2.51 \begin{align*} \frac{1}{3} \, B h^{2} x^{3} \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + \frac{1}{3} \, A h^{2} x^{3} + B g h x^{2} \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g h x^{2} + B g^{2} x \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g^{2} x + \frac{{\left (\frac{a e n \log \left (b x + a\right )}{b} - \frac{c e n \log \left (d x + c\right )}{d}\right )} B g^{2}}{e} - \frac{{\left (\frac{a^{2} e n \log \left (b x + a\right )}{b^{2}} - \frac{c^{2} e n \log \left (d x + c\right )}{d^{2}} + \frac{{\left (b c e n - a d e n\right )} x}{b d}\right )} B g h}{e} + \frac{{\left (\frac{2 \, a^{3} e n \log \left (b x + a\right )}{b^{3}} - \frac{2 \, c^{3} e n \log \left (d x + c\right )}{d^{3}} - \frac{{\left (b^{2} c d e n - a b d^{2} e n\right )} x^{2} - 2 \,{\left (b^{2} c^{2} e n - a^{2} d^{2} e n\right )} x}{b^{2} d^{2}}\right )} B h^{2}}{6 \, e} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.08998, size = 753, normalized size = 4.77 \begin{align*} \frac{2 \, A b^{3} d^{3} h^{2} x^{3} +{\left (6 \, A b^{3} d^{3} g h -{\left (B b^{3} c d^{2} - B a b^{2} d^{3}\right )} h^{2} n\right )} x^{2} + 2 \,{\left (3 \, A b^{3} d^{3} g^{2} -{\left (3 \,{\left (B b^{3} c d^{2} - B a b^{2} d^{3}\right )} g h -{\left (B b^{3} c^{2} d - B a^{2} b d^{3}\right )} h^{2}\right )} n\right )} x + 2 \,{\left (B b^{3} d^{3} h^{2} n x^{3} + 3 \, B b^{3} d^{3} g h n x^{2} + 3 \, B b^{3} d^{3} g^{2} n x +{\left (3 \, B a b^{2} d^{3} g^{2} - 3 \, B a^{2} b d^{3} g h + B a^{3} d^{3} h^{2}\right )} n\right )} \log \left (b x + a\right ) - 2 \,{\left (B b^{3} d^{3} h^{2} n x^{3} + 3 \, B b^{3} d^{3} g h n x^{2} + 3 \, B b^{3} d^{3} g^{2} n x +{\left (3 \, B b^{3} c d^{2} g^{2} - 3 \, B b^{3} c^{2} d g h + B b^{3} c^{3} h^{2}\right )} n\right )} \log \left (d x + c\right ) + 2 \,{\left (B b^{3} d^{3} h^{2} x^{3} + 3 \, B b^{3} d^{3} g h x^{2} + 3 \, B b^{3} d^{3} g^{2} x\right )} \log \left (e\right )}{6 \, b^{3} d^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 77.4189, size = 402, normalized size = 2.54 \begin{align*} \frac{1}{3} \,{\left (A h^{2} + B h^{2}\right )} x^{3} + \frac{1}{3} \,{\left (B h^{2} n x^{3} + 3 \, B g h n x^{2} + 3 \, B g^{2} n x\right )} \log \left (b x + a\right ) - \frac{1}{3} \,{\left (B h^{2} n x^{3} + 3 \, B g h n x^{2} + 3 \, B g^{2} n x\right )} \log \left (d x + c\right ) - \frac{{\left (B b c h^{2} n - B a d h^{2} n - 6 \, A b d g h - 6 \, B b d g h\right )} x^{2}}{6 \, b d} + \frac{{\left (3 \, B a b^{2} g^{2} n - 3 \, B a^{2} b g h n + B a^{3} h^{2} n\right )} \log \left (b x + a\right )}{3 \, b^{3}} - \frac{{\left (3 \, B c d^{2} g^{2} n - 3 \, B c^{2} d g h n + B c^{3} h^{2} n\right )} \log \left (-d x - c\right )}{3 \, d^{3}} - \frac{{\left (3 \, B b^{2} c d g h n - 3 \, B a b d^{2} g h n - B b^{2} c^{2} h^{2} n + B a^{2} d^{2} h^{2} n - 3 \, A b^{2} d^{2} g^{2} - 3 \, B b^{2} d^{2} g^{2}\right )} x}{3 \, b^{2} d^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]